<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Exams/index')}">考试管理</a></li>
			<li><a href="{:U('Exams/add')}">添加考试</a></li>
			<li><a href="{:U('Exams/recycle')}">考试回收站</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Exams/index')}">
			考试分类： 
			<select name="exam_term_id" style="width: 120px;">
				<option value='0'>全部</option>{$exam_taxonomys}
			</select> &nbsp;&nbsp;
			工种（试题）分类： 
			<select name="ques_term_id" style="width: 120px;">
				<option value='0'>全部</option>{$ques_taxonomys}
			</select> &nbsp;&nbsp;
			考试标题：
			<input type="text" name="keyword" style="width: 200px;" value="{$keyword}" placeholder="请输入题干">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Exams/index')}">清空</a>
		</form>
		<form class="js-ajax-form" action="{:U('Exams/listorders')}" method="post">
			<table class="table table-hover table-bordered table-list" id="menus-table">
				<thead>
					<tr>
						<th width="40">ID</th>
						<th>考试名称</th>
						<th width="120">开考时间</th>
						<th>考试时长</th>
						<th width="150">考试分类/工种</th>
						<th width="100">报名/参考情况</th>
						<th>创建时间</th>
						<th width="40">{:L('STATUS')}</th>
						<th width="80">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
				<foreach name="exams" item="vo">
				<tr>
					<td>{$vo['id']}</td>
					<td>
						<notempty name="term">
						<a href="{:leuu('admin/Paper/index',array('id'=>$vo['id'],'cid'=>$term['term_id']))}" target="_blank">{$vo.exam_title}</a>
						<else/>
							{$vo.exam_name}
						</notempty>
					</td>
					<td>{:date('Y-m-d H:i',strtotime($vo['exam_start_time']))}</td>
					<td><php>echo floor($vo['exam_duration']/60).'时'.($vo['exam_duration']%60).'分';</php></td>
					<td>{$vo['exam_term_name']}/{$vo['ques_term_name']}</td>
					<td>{$vo['sign_count']}人<a href="javascript:showSignin('{:U('Exams/users','exam_id='.$vo['id'])}')"><i class="fa fa-eye"></i>查看</a> </td>
					<td>{:date('Y-m-d H:i',strtotime($vo['exam_date']))}</td>
					<td>
						<eq name="vo.exam_status" value="0">
							<a data-toggle="tooltip" title="已启用"><i class="fa fa-check"></i></a>
							<else/>
							<a data-toggle="tooltip" title="已停用"><i class="fa fa-close"></i></a>
						</eq>
					</td>
					<td>
						<a href="{:U('Exams/edit',array('id'=>$vo['id']))}">{:L('EDIT')}</a> | 
						<a href="{:U('Exams/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
					</td>
				</tr>
				</foreach>
				</tbody>
				<tfoot>
					<tr>
						<th width="40">ID</th>
						<th>考试名称</th>
						<th width="120">开考时间</th>
						<th>考试时长</th>
						<th width="150">考试分类/工种</th>
						<th width="80">报名情况</th>
						<th>创建时间</th>
						<th width="40">{:L('STATUS')}</th>
						<th width="80">{:L('ACTIONS')}</th>
					</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
	<script>
		function showSignin(url){		
			layer.open({
			      type: 2,
			      title: '报名及考试情况查看',
			      shadeClose: true,
			      shade: false,
			      maxmin: true, //开启最大化最小化按钮
			      area: ['893px', '570px'],
			      content: url,
			      success:function(layero, index){
			    	  //layer.full(index);
			      }
			});
		}
		function showFinish(url){
			showSignin(url);
		}
		
		$(document).ready(function() {
			Wind.css('treeTable');
			Wind.use('treeTable', function() {
				$("#menus-table").treeTable({
					indent : 20
				});
			});
		});

		setInterval(function() {
			var refersh_time = getCookie('refersh_time_admin_menu_index');
			if (refersh_time == 1) {
				reloadPage(window);
			}
		}, 1000);
		setCookie('refersh_time_admin_menu_index', 0);
	</script>
</body>
</html>